package com.en.sharing.serviceprovider.bpm.approval;

import com.en.sharing.serviceprovider.bpm.OperationApprovalProcess;

import java.util.Map;

/**
 * 模拟下游审批系统的审批
 *
 * @author 付晓飞
 * @date 2024/3/11 7:16 下午
 */
public class ApprovalService {

    private String taskId;

    public void submitApproval(String taskId, Map<String, Object> oldData, Map<String, Object> newData) {
        // do something
        System.out.println("审批提交完成：" + taskId);
        this.taskId = taskId;
    }

    public void approval(boolean isPass, OperationApprovalProcess operationApprovalProcess) {
        // 简单的模拟消息队列通知
        operationApprovalProcess.noticeApprovalResultProcess(taskId, isPass);
    }

}
